package com.boho.ecp.cart.dao;

import java.sql.Connection;

import com.boho.ecp.constant.Member;

import cn.boho.framework.po.CQuery;
import cn.boho.framework.po.CQueryFactoryTool;
import cn.boho.framework.po.DAO;
import cn.boho.framework.po.DynaBeanMap;

public class CartDao extends DAO {

	public static DynaBeanMap getCartByMemberId(Connection con, Integer memberId) throws Exception {
		DynaBeanMap dynaBeanMap = null;
		StringBuffer sql = new StringBuffer();
		sql.append("select * from MEMBER_COOKIE where MEMBER_ID = ? and IS_VALID = ?");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		query.setInt(1, memberId);
		query.setInt(2, Member.VAILD);
		dynaBeanMap = query.getDynaBeanMap("MEMBER_COOKIE", con);
		return dynaBeanMap;
	}
	
}
